
package wk.demo.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;

import com.luoye.bzijkplayer.R;

import wk.demo.activities.VideoActivity;
import wk.demo.tool.MyToastTool;


public class RemoteFileFragmetn extends Fragment {

    public static RemoteFileFragmetn newInstance() {
        return new RemoteFileFragmetn();
    }


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView =  inflater.inflate(R.layout.fileurl_input_lay, container, false);
        EditText fileUrl = rootView.findViewById(R.id.fileUrl);

        rootView.findViewById(R.id.toPlayer).setOnClickListener(v -> {
            String url =fileUrl.getText().toString().trim() ;
            if (TextUtils.isEmpty(url)){
                MyToastTool.toastMsg(getActivity() ,"不能为空");
            }else{
                VideoActivity.intentTo(getActivity(), url  );
            }

        });
        return rootView;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
    }

}
